$OpenBSD: patch-src_pkcs11_Makefile_in,v 1.4 2015/06/15 09:36:42 dcoppa Exp $

Do not install shared modules under ${PREFIX}/lib/ and avoid the
nasty symlink dance

Use --tag=disable-static to disable libtool static archives for
modules

--- src/pkcs11/Makefile.in.orig	Sat May 16 22:30:43 2015
+++ src/pkcs11/Makefile.in	Mon Jun 15 11:18:27 2015
@@ -77,7 +77,7 @@ am__nobase_list = $(am__nobase_strip_setup); \
 am__base_list = \
   sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
   sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__installdirs = "$(DESTDIR)$(libdir)"
+am__installdirs = "$(DESTDIR)$(pkcs11dir)"
 LTLIBRARIES = $(lib_LTLIBRARIES)
 am__DEPENDENCIES_1 =
 am__DEPENDENCIES_2 = $(top_builddir)/src/libopensc/libopensc.la \
@@ -217,6 +217,7 @@ LIBOBJS = @LIBOBJS@
 LIBRARY_BITNESS = @LIBRARY_BITNESS@
 LIBS = @LIBS@
 LIBTOOL = @LIBTOOL@
+LIBTOOLFLAGS = --tag=disable-static
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
@@ -429,25 +430,25 @@ versioninfo-pkcs11-spy.rc: $(top_builddir)/config.stat
 	cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
 install-libLTLIBRARIES: $(lib_LTLIBRARIES)
 	@$(NORMAL_INSTALL)
-	test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)"
-	@list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
+	test -z "$(pkcs11dir)" || $(MKDIR_P) "$(DESTDIR)$(pkcs11dir)"
+	@list='$(lib_LTLIBRARIES)'; test -n "$(pkcs11dir)" || list=; \
 	list2=; for p in $$list; do \
 	  if test -f $$p; then \
 	    list2="$$list2 $$p"; \
 	  else :; fi; \
 	done; \
 	test -z "$$list2" || { \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkcs11dir)'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkcs11dir)"; \
 	}
 
 uninstall-libLTLIBRARIES:
 	@$(NORMAL_UNINSTALL)
-	@list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
+	@list='$(lib_LTLIBRARIES)'; test -n "$(pkcs11dir)" || list=; \
 	for p in $$list; do \
 	  $(am__strip_dir) \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkcs11dir)/$$f'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkcs11dir)/$$f"; \
 	done
 
 clean-libLTLIBRARIES:
@@ -461,9 +462,9 @@ clean-libLTLIBRARIES:
 onepin-opensc-pkcs11.la: $(onepin_opensc_pkcs11_la_OBJECTS) $(onepin_opensc_pkcs11_la_DEPENDENCIES) 
 	$(AM_V_CCLD)$(onepin_opensc_pkcs11_la_LINK) -rpath $(libdir) $(onepin_opensc_pkcs11_la_OBJECTS) $(onepin_opensc_pkcs11_la_LIBADD) $(LIBS)
 opensc-pkcs11.la: $(opensc_pkcs11_la_OBJECTS) $(opensc_pkcs11_la_DEPENDENCIES) 
-	$(AM_V_CCLD)$(opensc_pkcs11_la_LINK) -rpath $(libdir) $(opensc_pkcs11_la_OBJECTS) $(opensc_pkcs11_la_LIBADD) $(LIBS)
+	$(AM_V_CCLD)$(opensc_pkcs11_la_LINK) -rpath $(pkcs11dir) $(opensc_pkcs11_la_OBJECTS) $(opensc_pkcs11_la_LIBADD) $(LIBS)
 pkcs11-spy.la: $(pkcs11_spy_la_OBJECTS) $(pkcs11_spy_la_DEPENDENCIES) 
-	$(AM_V_CCLD)$(pkcs11_spy_la_LINK) -rpath $(libdir) $(pkcs11_spy_la_OBJECTS) $(pkcs11_spy_la_LIBADD) $(LIBS)
+	$(AM_V_CCLD)$(pkcs11_spy_la_LINK) -rpath $(pkcs11dir) $(pkcs11_spy_la_OBJECTS) $(pkcs11_spy_la_LIBADD) $(LIBS)
 
 mostlyclean-compile:
 	-rm -f *.$(OBJEXT)
@@ -699,7 +700,7 @@ check-am: all-am
 check: check-am
 all-am: Makefile $(LTLIBRARIES) $(SCRIPTS)
 installdirs:
-	for dir in "$(DESTDIR)$(libdir)"; do \
+	for dir in "$(DESTDIR)$(pkcs11dir)"; do \
 	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
 	done
 install: install-am
@@ -759,7 +760,6 @@ install-dvi-am:
 
 install-exec-am: install-libLTLIBRARIES
 	@$(NORMAL_INSTALL)
-	$(MAKE) $(AM_MAKEFLAGS) install-exec-hook
 install-html: install-html-am
 
 install-html-am:
@@ -807,7 +807,7 @@ uninstall-am: uninstall-libLTLIBRARIES
 	distclean-compile distclean-generic distclean-libtool \
 	distclean-tags distdir dvi dvi-am html html-am info info-am \
 	install install-am install-data install-data-am install-dvi \
-	install-dvi-am install-exec install-exec-am install-exec-hook \
+	install-dvi-am install-exec install-exec-am \
 	install-html install-html-am install-info install-info-am \
 	install-libLTLIBRARIES install-man install-pdf install-pdf-am \
 	install-ps install-ps-am install-strip installcheck \
@@ -831,18 +831,6 @@ pkcs11-jar: jar-dir
 	cp opensc_pkcs11_install.js jar-dir
 	signtool -Z"opensc-pkcs11.jar" -i"opensc_pkcs11_install.js" \
 		 -k"testcert" jar-dir
-
-@WIN32_TRUE@install-exec-hook:
-@WIN32_TRUE@	$(MKDIR_P) "$(DESTDIR)$(libdir)"
-@WIN32_TRUE@	for l in opensc-pkcs11.dll pkcs11-spy.dll; do \
-@WIN32_TRUE@		mv "$(DESTDIR)$(libdir)/$$l" "$(DESTDIR)$(bindir)/$$l"; \
-@WIN32_TRUE@	done
-@WIN32_FALSE@install-exec-hook:
-@WIN32_FALSE@	$(MKDIR_P) "$(DESTDIR)$(pkcs11dir)"
-@WIN32_FALSE@	for l in opensc-pkcs11$(PKCS11_SUFFIX) onepin-opensc-pkcs11$(PKCS11_SUFFIX) pkcs11-spy$(PKCS11_SUFFIX); do \
-@WIN32_FALSE@		rm -f "$(DESTDIR)$(pkcs11dir)/$$l"; \
-@WIN32_FALSE@		$(LN_S) ../$$l "$(DESTDIR)$(pkcs11dir)/$$l"; \
-@WIN32_FALSE@	done
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
